package com.kanan.vueupload.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class MultipartFileParamEntity implements Serializable {
    /**
     * 文件传输任务ID
     */
    private String taskId;
    /**
     * 当前为第几分片
     */
    private Long chunkNumber;
    /**
     * 分片总数
     */
    private Long totalChunks;
    /**
     * 每个分块的大小
     */
    private Long chunkSize;
    /**
     * 当前分片大小
     */
    private Long currentChunkSize;
    /**
     * 文件总大小
     */
    private Long totalSize;
    /**
     * 文件名称
     */
    private String filename;
    /**
     * 文件唯一标识
     */
    private String identifier;

    /**
     * 自动合并
     */
    private Boolean autoMerge;

    /**
     * 分块文件传输对象
     */
    private MultipartFile file;

    public Boolean getAutoMerge() {
        return autoMerge!=null ? autoMerge : true;
    }

    public void setAutoMerge(Boolean autoMerge) {
        this.autoMerge = autoMerge;
    }
}